package cn.jbooter.repository.autoconfigure.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "spring.datasource.druid")
public class RepositoryProperties {
	/** 默认的mybatis配置文件位置 **/
	private static final String DEFAULT_MYBATIS_CONFIG_LOCATION="classpath:dft_mybatis_configure/mybatis-default-config.xml";
	
	/** 第1数据源配置 **/
	private First first = new First();
	/** 第二数据源配置 **/
	private Second second = new Second();
	
	public First getFirst() {
		return first;
	}
	public void setFirst(First first) {
		this.first = first;
	}
	public Second getSecond() {
		return second;
	}
	public void setSecond(Second second) {
		this.second = second;
	}

	/**
	 * 第一数据源的配置
	 * @author hejian
	 *
	 */
	public static class First{
		/** 是否开启第1数据源 **/
		private boolean enabled = false;
		/** 第1数据源mybatis配置文件位置 **/
		private String mybatisConfigLocation=DEFAULT_MYBATIS_CONFIG_LOCATION;
		
		public String getMybatisConfigLocation() {
			return mybatisConfigLocation;
		}
		public void setMybatisConfigLocation(String mybatisConfigLocation) {
			this.mybatisConfigLocation = mybatisConfigLocation;
		}
		public boolean isEnabled() {
			return enabled;
		}
		public void setEnabled(boolean enabled) {
			this.enabled = enabled;
		}
	}
	
	/**
	 * 第二数据源的配置
	 * @author hejian
	 *
	 */
	public static class Second{
		/** 是否开启第2数据源 **/
		private boolean enabled = false;
		/** 第2数据源mybatis配置文件位置 **/
		private String mybatisConfigLocation=DEFAULT_MYBATIS_CONFIG_LOCATION;
		
		public String getMybatisConfigLocation() {
			return mybatisConfigLocation;
		}
		public void setMybatisConfigLocation(String mybatisConfigLocation) {
			this.mybatisConfigLocation = mybatisConfigLocation;
		}
		public boolean isEnabled() {
			return enabled;
		}
		public void setEnabled(boolean enabled) {
			this.enabled = enabled;
		}
	}
	
	
}
